package com.nuo.quartz.beans.pojo.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 定时任务新增
 * @author LGC
 */
@ApiModel(value="QuartzJobAddReqDTO", description="定时任务新增")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class QuartzJobAddReqDTO implements Serializable {

    private static final long serialVersionUID = -4792671599004283116L;

    @ApiModelProperty(value = "任务模式 1.bean模式  2.http模式")
    @NotNull(message = "任务模式不能为空")
    private Integer jobMode;

    @ApiModelProperty(value = "jobMode =1: 执行Bean名称,jobMode =2:调度接口地址，一般为开放接口")
    @NotBlank(message = "执行Bean名称不能为空")
    private String beanName;

    @ApiModelProperty(value = "执行参数，JSON字符串")
    private String params;

    @ApiModelProperty(value = "cron表达式")
    @NotBlank(message = "cron表达式不能为空")
    private String cron;

    @ApiModelProperty(value = "状态：1正常，2暂停")
    @NotNull(message = "状态不能为空")
    private Integer state;

    @ApiModelProperty(value = "备注")
    private String remark;

}